﻿namespace GmailReader
{
    using System;
    using System.Collections.Generic;
    using System.Text;
    using System.Net;

    public class FeedDownloader : IFeedDownloader
    {
        private const string FEEDURL = @"https://mail.google.com/mail/feed/atom";
        
        private WebClient webClient;

        public FeedDownloader(string username, string password)
        {
            this.webClient = new WebClient();
            this.webClient.Credentials = new NetworkCredential(username, password);
        }

        public string Download()
        {
            return this.webClient.DownloadString(FEEDURL);
        }
    }
}
